Revert "wayland: Prevent stale paints and weird artifacts when using Weston"
authorJasper St. Pierre <jstpierre@mecheye.net>
Mon, 14 Jul 2014 23:12:19 +0000 (19:12 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Mon, 14 Jul 2014 23:12:19 +0000 (19:12 -0400)
This reverts commit 76922c169f0699d9b85ef3eff2170f2cede1782c.

This is too local a fix, and is broken if the user paints to a small
region, as the entire buffer will be wiped.

gdk/wayland/gdkdisplay-wayland.c
gdk/wayland/gdkprivate-wayland.h
gdk/wayland/gdkwindow-wayland.c

index d83d364f48cf151e69899af506cebd082f76f690..ee8e903f388b45be276f8921885dbca78d2d69f2 100644 (file)
@@ -889,10 +889,3 @@ _gdk_wayland_shm_surface_get_busy (cairo_surface_t *surface)
   GdkWaylandCairoSurfaceData *data = cairo_surface_get_user_data (surface, &gdk_wayland_cairo_key);
   return data->busy;
 }
-
-void
-_gdk_wayland_shm_surface_clear (cairo_surface_t *surface)
-{
-  GdkWaylandCairoSurfaceData *data = cairo_surface_get_user_data (surface, &gdk_wayland_cairo_key);
-  memset (data->buf, 0, data->buf_length);
-}
index a3146ead960aac5bf7989068075264b2db813a4e..d6d2375429c33f357d13a9a7f71afe65472aea58 100644 (file)
@@ -185,6 +185,5 @@ cairo_surface_t * _gdk_wayland_display_create_shm_surface (GdkWaylandDisplay *di
 struct wl_buffer *_gdk_wayland_shm_surface_get_wl_buffer (cairo_surface_t *surface);
 void _gdk_wayland_shm_surface_set_busy (cairo_surface_t *surface);
 gboolean _gdk_wayland_shm_surface_get_busy (cairo_surface_t *surface);
-void _gdk_wayland_shm_surface_clear (cairo_surface_t *surface);
 
 #endif /* __GDK_PRIVATE_WAYLAND_H__ */
index f57ba6c77591a36ebcbadf5b3266210600388347..5782474112dd52741f9afeaa119c7780f87ce0f0 100644 (file)
@@ -568,23 +568,7 @@ gdk_window_impl_wayland_begin_paint_region (GdkWindow            *window,
 {
   GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
   gdk_wayland_window_ensure_cairo_surface (window);
-
-  if (_gdk_wayland_shm_surface_get_busy (impl->cairo_surface))
-    {
-      /* The surface is busy, so create a temporary surface which we paint
-       * to and hope that by the time we're done painting the surface isn't
-       * busy any more. */
-      return TRUE;
-    }
-  else
-    {
-      /* Returning FALSE from begin_paint_region says to use the native
-       * backing surface, which is our SHM surface. We need to make sure
-       * to clear it before the code tries to paint to it to prevent
-       * artifacts from the last paint. */
-      _gdk_wayland_shm_surface_clear (impl->cairo_surface);
-      return FALSE;
-    }
+  return _gdk_wayland_shm_surface_get_busy (impl->cairo_surface);
 }
 
 static void